package cn.fl.riskctrl.jxldb.transform;

import java.util.ArrayList;
import java.util.List;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.riskctrl.jxldb.vo.JxlmgIdOrgDubtVO;
import fl.riskctrl.facade.jxldb.dto.JxlmgIdOrgDubtDTO;

 /**
 * @Description:  转换器
 * @Description: VO是客户端传递数据到服务端进行转换的数据 
 * @Description: VO转换数据变成DTO传递到服务端 
 * @Description: VO不能在服务端出现
 */
public class JxlmgIdOrgDubtVOTransform {


	/**
	 * DTO 转  VO
	 * @param po JxlmgIdOrgDubtDTO
	 * @return JxlmgIdOrgDubtVO
	 */
	public static JxlmgIdOrgDubtVO toVO(JxlmgIdOrgDubtDTO dto) {
		JxlmgIdOrgDubtVO  vo = null;
		if (dto != null) { 
			vo = new JxlmgIdOrgDubtVO();
			vo.setId(dto.getId());
			vo.setOrgTyp(dto.getOrgTyp());//ORG_TYP
			vo.setBindTm(dto.getBindTm());//BIND_TM
			vo.setReportNo(dto.getReportNo());//REPORT_NO

			vo.setCrtTm(dto.getCrtTm());//创建时间
			vo.setCrtUsrId(dto.getCrtUsrId());//创建人
			vo.setMdfTm(dto.getMdfTm());//修改时间
			vo.setMdfUsrId(dto.getMdfUsrId());//修改人
		}
		return vo;
	}

	/**
	 * VO 转 DTO
	 * @param dto JxlmgIdOrgDubtVO
	 * @return JxlmgIdOrgDubtDTO
	 */
	public static JxlmgIdOrgDubtDTO toDTO(JxlmgIdOrgDubtVO vo) {
		JxlmgIdOrgDubtDTO dto = null;
		if (vo != null) {
			dto = new JxlmgIdOrgDubtDTO();
			dto.setId(vo.getId());
			dto.setOrgTyp(vo.getOrgTyp());//ORG_TYP
			dto.setBindTm(vo.getBindTm());//BIND_TM
			dto.setReportNo(vo.getReportNo());//REPORT_NO

			dto.setCrtTm(vo.getCrtTm());//创建时间
			dto.setCrtUsrId(vo.getCrtUsrId());//创建人
			dto.setMdfTm(vo.getMdfTm());//修改时间
			dto.setMdfUsrId(vo.getMdfUsrId());//修改人
		}
		return dto;
	}
	
	/**
	 * DTO集合 转 VO集合
	 * @param List<JxlmgIdOrgDubtDTO>
	 * @return List<JxlmgIdOrgDubtVO>
	 */
	public static List<JxlmgIdOrgDubtVO> toVOList(List<JxlmgIdOrgDubtDTO> list) {
		List<JxlmgIdOrgDubtVO>  voList = new ArrayList<JxlmgIdOrgDubtVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (JxlmgIdOrgDubtDTO dto : list) {
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
	
	/**
	 * VO集合 转 DTO集合
	 * @param list List<JxlmgIdOrgDubtVO>
	 * @return List<JxlmgIdOrgDubtDTO>
	 */
	public static List<JxlmgIdOrgDubtDTO> toDTOList(List<JxlmgIdOrgDubtVO> list) {
		List<JxlmgIdOrgDubtDTO>  dtoList = new ArrayList<JxlmgIdOrgDubtDTO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (JxlmgIdOrgDubtVO vo : list) {
				dtoList.add(toDTO(vo));
			}
		}
		return dtoList;
	}
}
